package com.farm.pojo;

import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author farm
 * @since 2024-08-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor

public class SpiderData implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String category;

    private String name;

    private Double lowestPrice;

    private Double averagePrice;

    private Double highestPrice;

    private String specification;

    private String unit;

    private Date publishTime;

    private LocalDateTime createTime;


    public SpiderData(String category, String name, Double lowestPrice, Double averagePrice, Double highestPrice, String specification, String unit, Date publishTime) {
        this.category = category;
        this.name = name;
        this.lowestPrice = lowestPrice;
        this.averagePrice = averagePrice;
        this.highestPrice = highestPrice;
        this.specification = specification;
        this.unit = unit;
        this.publishTime = publishTime;
        this.createTime = LocalDateTime.now();
    }
}
